<?php

use Illuminate\Database\Seeder;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $data = [];
        for($i = 0; $i < 1000; $i++)
        {
            $temp['name'] = str_random(6);
            $temp['password'] = Crypt::encrypt(123);
            $temp['tppassword'] = Crypt::encrypt(123);
            $temp['email'] = str_random(5)."@qq.com";
            $temp['phone'] = '13'.rand(10000,99999).rand(1000,9999);
            $time = date('Y-m-d H:i:s');
            $temp['created_at'] = $time;
            $temp['updated_at'] = $time;

            $data[] = $temp;
        }
        DB::table('user') -> insert($data);
    }
}
